package Stream;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.util.Date;

public class Test05_ObjectOutputStream {
	public static void main(String[] args){
		ObjectOutputStream dos = null;
		try{
			dos= new ObjectOutputStream(new FileOutputStream("test.ser"));
			dos.writeObject(new String("안녕"));
			dos.writeObject(new Integer(50));
			dos.writeObject(new Date());
			dos.close();
			System.out.println("객체를 파일로 저장성공!!!!!!");
			
		}catch(FileNotFoundException fe){
			System.out.println(fe.getMessage());
		}catch(IOException ie){
			System.out.println(ie.getMessage());
		}
		
	}
}
